import React, { Component } from 'react'
import "./index.css"

export default class Parent extends Component {
    state = {name:"tom"}
    render() {
        return (
            <div className="parent">
                <h1>Parent///</h1>
                <A render={(name)=><B name={name} />} />
            </div>
        )
    }
}
class A extends Component {
    state = {name:"javis"}
    render() {
        const {name} = this.state
        console.log(this.props)
        return (
            <div className="a">
                <h1>A///</h1>
                {this.props.render(name)}
            </div>
        )
    }
}
class B extends Component {
    render() {
        return (
            <div className="b">
                {/* <h1>B///,{this.props.children}</h1> */}
                <h1>B///,{this.props.name}</h1>
            </div>
        )
    }
}

